<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox-content">
                <div class="row">
                   <form action="<?=url('group.order/create')?>"  id="form-create" method="post" class="form-horizontal" role="form"> 
                    
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>会员：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->user_id)?$detail->user_id:''?>" placeholder="" id="user_id" name="user_id"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>订单类型：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->group_id)?$detail->group_id:''?>" placeholder="" id="group_id" name="group_id"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>总价：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->total_price)?$detail->total_price:''?>" placeholder="" id="total_price" name="total_price"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>实际需要支付：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->need_pay)?$detail->need_pay:''?>" placeholder="" id="need_pay" name="need_pay"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>优惠券：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->pay_coupon)?$detail->pay_coupon:''?>" placeholder="" id="pay_coupon" name="pay_coupon"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>已支付：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->pay_money)?$detail->pay_money:''?>" placeholder="" id="pay_money" name="pay_money"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
   <label class="col-sm-3 control-label"><span class="c-red">*</span>支付时间：</label>
   <div class="col-sm-9">
       <input  value="<?=isset($detail->pay_time)?date('Y-m-d H:i:s',$detail->pay_time):''?>"   name="pay_time" id="pay_time"  class="laydate-icon form-control layer-date">
       
   </div>
</div>
<script>
 laydate({
    elem: '#pay_time',
    event: 'focus' ,
    format: 'YYYY-MM-DD hh:mm:ss',
    istime: true
});
</script>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>支付时间：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->pay_time)?$detail->pay_time:''?>" placeholder="" id="pay_time" name="pay_time"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>支付信息：</label>
    <div class="col-sm-9">
        <textarea  name="pay_info" placeholder="说点什么...最少输入10个字符" id="pay_info"  cols="50" rows="10" class="form-control"><?=isset($detail->pay_info)?$detail->pay_info:''?></textarea>
        
    </div>
 </div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>是否评论：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->is_comment)?$detail->is_comment:''?>" placeholder="" id="is_comment" name="is_comment"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>状态：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->status)?$detail->status:''?>" placeholder="" id="status" name="status"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
   <label class="col-sm-3 control-label"><span class="c-red">*</span>拼团过期时间：</label>
   <div class="col-sm-9">
       <input  value="<?=isset($detail->expire_time)?date('Y-m-d H:i:s',$detail->expire_time):''?>"   name="expire_time" id="expire_time"  class="laydate-icon form-control layer-date">
       
   </div>
</div>
<script>
 laydate({
    elem: '#expire_time',
    event: 'focus' ,
    format: 'YYYY-MM-DD hh:mm:ss',
    istime: true
});
</script>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>拼团过期时间：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->expire_time)?$detail->expire_time:''?>" placeholder="" id="expire_time" name="expire_time"  class="form-control" /> 
    </div>
 </div>
<link rel="stylesheet" type="text/css" href="/public/common/webuploader-0.1.5/webuploader.css">
<script type="text/javascript" src="/public/common/webuploader-0.1.5/webuploader.js"></script>



<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>快递信息：</label>
    <div class="col-sm-9 ">      
        
        <div id="uploader-demo" style="max-width: 300px">
            <!--用来存放item-->
            <div id="mail_numberList" class="uploader-list">
                <?php if(isset($detail['mail_number'])){?>
                <div  class="file-item thumbnail"><img width="110" src="/attachs/uploads/<?=$detail['mail_number']?>"><input type="hidden" value="<?=$detail['mail_number']?>" name="mail_number" id="mail_number"></div>
                <?php }?>
            </div>
            <div id="mail_numberPicker">选择图片</div>
        </div>

           
    </div>
</div>    
        
 
<script>


    
var uploadermail_number = WebUploader.create({
    auto: true,
    swf: '/public/admin/Widget/webuploader-0.1.5/Uploader.swf',
    server: '<?=url("upload.upload/index",['mdl'=>"order_mail_number"])?>',
    pick: '#mail_numberPicker',
    resize : false,  
    duplicate :true
});

$(document).on('click','.file-item',function(){
    $(this).remove();
});

// 当有文件添加进来的时候
uploadermail_number.on( 'fileQueued', function( file ) {
    var $li = $(
            '<div id="' + file.id + '" class="file-item thumbnail">' +
                '<img>' +
                '<input type="hidden" value="" name="mail_number" id="mail_number">' +
                '<div class="info">' + file.name + '</div>' +
            '</div>'
            ),
        $img = $li.find('img');


    // $list为容器jQuery实例
    $("#mail_numberList").html($li);

    // 创建缩略图
    // 如果为非图片文件，可以不用调用此方法。
    // thumbnailWidth x thumbnailHeight 为 100 x 100
    uploadermail_number.makeThumb( file, function( error, src ) {
        if ( error ) {
            $img.replaceWith('<span>不能预览</span>');
            return;
        }

        $img.attr( 'src', src );
    }, 100,100 );
});


// 文件上传过程中创建进度条实时显示。
uploadermail_number.on( 'uploadProgress', function( file, percentage ) {
    var $li = $( '#'+file.id ),
        $percent = $li.find('.progress span');

    // 避免重复创建
    if ( !$percent.length ) {
        $percent = $('<p class="progress"><span></span></p>')
                .appendTo( $li )
                .find('span');
    }

    $percent.css( 'width', percentage * 100 + '%' );
});

// 文件上传成功，给item添加成功class, 用样式标记上传成功。
uploadermail_number.on( 'uploadSuccess', function( file ,response ) {
    $( '#'+file.id ).addClass('upload-state-done');
    $("#mail_number").val(response._raw);
});

// 文件上传失败，显示上传出错。
uploadermail_number.on( 'uploadError', function( file ) {
    var $li = $( '#'+file.id ),
        $error = $li.find('div.error');

    // 避免重复创建
    if ( !$error.length ) {
        $error = $('<div class="error"></div>').appendTo( $li );
    }

    $error.text('上传失败');
});

// 完成上传完了，成功或者失败，先删除进度条。
uploadermail_number.on( 'uploadComplete', function( file ) {
    $( '#'+file.id ).find('.progress').remove();
});

</script>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>收货人：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->name)?$detail->name:''?>" placeholder="" id="name" name="name"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>联系方式：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->mobile)?$detail->mobile:''?>" placeholder="" id="mobile" name="mobile"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>地址：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->gps_addr)?$detail->gps_addr:''?>" placeholder="" id="gps_addr" name="gps_addr"  class="form-control" /> 
    </div>
 </div>
<div class="form-group">
   <label class="col-sm-3 control-label"><span class="c-red">*</span>下单时间：</label>
   <div class="col-sm-9">
       <input  value="<?=isset($detail->add_time)?date('Y-m-d H:i:s',$detail->add_time):''?>"   name="add_time" id="add_time"  class="laydate-icon form-control layer-date">
       
   </div>
</div>
<script>
 laydate({
    elem: '#add_time',
    event: 'focus' ,
    format: 'YYYY-MM-DD hh:mm:ss',
    istime: true
});
</script>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span class="c-red">*</span>下单时间：</label>
    <div class="col-sm-9">
            <input type="text"  value="<?=isset($detail->add_time)?$detail->add_time:''?>" placeholder="" id="add_time" name="add_time"  class="form-control" /> 
    </div>
 </div>
                    <div class="clearfix form-actions">
                            <div class="col-md-offset-3 col-md-9">
                                    <button mini="submit" for="form-create" class="btn btn-info" type="button">
                                            <i class="ace-icon fa fa-check bigger-110"></i>
                                            保存
                                    </button>
                            </div>
                    </div>
                   </form>

               </div></div>
        </div>
    </div>
</div>